ext4: fix false negatives *and* false positives in ext4_check_descriptors()
authorTheodore Ts'o <tytso@mit.edu>
Sun, 8 Jul 2018 23:35:02 +0000 (19:35 -0400)
committerSalvatore Bonaccorso <carnil@debian.org>
Fri, 20 Jul 2018 21:08:27 +0000 (22:08 +0100)
commitd3c9719ae0a47a21646f438bbe04c40b898d2893
treeb9fef639835fe3e01316de0f62a46ee00595e2d5
parent26acee067613431f6dfb7a67efe856f134a0dfc4
ext4: fix false negatives *and* false positives in ext4_check_descriptors()

Ext4_check_descriptors() was getting called before s_gdb_count was
initialized.  So for file systems w/o the meta_bg feature, allocation
bitmaps could overlap the block group descriptors and ext4 wouldn't
notice.

For file systems with the meta_bg feature enabled, there was a
fencepost error which would cause the ext4_check_descriptors() to
incorrectly believe that the block allocation bitmap overlaps with the
block group descriptor blocks, and it would reject the mount.

Fix both of these problems.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@vger.kernel.org
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name ext4-fix-false-negatives-and-false-positives-in-ext4.patch
fs/ext4/super.c